﻿using System.Globalization;
using System.Web.Mvc;
using CRM.Database.Model;
using DB = CRM.Models.DB;

namespace CRM.Controllers
{
    [Localize]
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.GreetingMessage = Resourses.Resourses.WelcomeStr;

            //CRM.Database.Model.TechnicReport10Collection col = new TechnicReport10Collection();

            //var i = col.TechnicReport10List.Count;
            
            return View();
        }
        
        public ActionResult About()
        {
            return View();
        }

        public ActionResult ChangeCulture(string lang, string returnUrl)
        {
            Session["Culture"] = new CultureInfo(lang);
            return Redirect(returnUrl);
        }

        /// <summary>
        /// Вызов страницы с ошибкой, когда доступ пользователя запрещен
        /// </summary>
        /// <returns></returns>
        public ActionResult Error()
        {
            ViewBag.PageFrom= "";
            return View();
        }

        public ActionResult Empty()
        {
            return View();
        }

        public ActionResult SAPSync()
        {
          //  DB.SAPBDSync();
            return View();
        }


        //public FileContentResult Help()
        //{
        //    return 
        //}
    }
}
